import request from '@/utils/request'

// 查询巡更点列表
export function listPoint(query) {
  return request({
    url: '/module/event/patrol/point/list',
    method: 'get',
    params: query
  })
}

// 查询巡更点详细
export function getPoint(id) {
  return request({
    url: '/module/event/patrol/point/' + id,
    method: 'get'
  })
}

// 新增巡更点
export function addPoint(data) {
  return request({
    url: '/module/event/patrol/point',
    method: 'post',
    data
  })
}

// 修改巡更点状态
export function updatePointState(id, state) {
  const data = {
    id,
    state
  };
  return request({
    url: '/module/event/patrol/point/updateState',
    method: 'put',
    data
  })
}

// 修改巡更点
export function updatePoint(data) {
  return request({
    url: '/module/event/patrol/point',
    method: 'put',
    data
  })
}

// 删除巡更点
export function delPoint(id) {
  return request({
    url: '/module/event/patrol/point/' + id,
    method: 'delete'
  })
}

// 导出巡更点
export function exportPoint(query) {
  return request({
    url: '/module/event/patrol/point/export',
    method: 'get',
    params: query
  })
}


// 重置二维码
export function resetQrCode(data) {
  return request({
    url: '/module/event/patrol/point/resetQrCode',
    method: 'post',
    data: data
  })
}
